import { getAction, deleteAction, putAction, postAction, httpAction, downFile } from '@/api/manage'

const serviceName = '/sjsk-performance-service/sjsk'
const sysDepart = '/sys/sysDepart'

/*-----------指标管理-----------*/
// 指标列表查询
const getIndicatorList = (params) => getAction(`${serviceName}/indicator/getIndicatorList`, params)
// 指标列表查询（新）
const selectIndicatorList = (params) => getAction(`${serviceName}/indicator/selectIndicatorList`, params)
// 添加目录
const addCatalogue = (params) => postAction(`${serviceName}/indicator/addCatalogue`, params)
// 修改目录
const updateCatalogue = (params) => postAction(`${serviceName}/indicator/updateCatalogue`, params)
// 添加指标
const addIndicator = (params) => postAction(`${serviceName}/indicator/addIndicator`, params)
// 导出指标
const exportIndicator = (params) => postAction(`${serviceName}/indicator/exportIndicator`, params)
// 根据指标编号修改指标信息
const updateIndicatorById = (params) => postAction(`${serviceName}/indicator/updateIndicatorById`, params)
// 复制指标
const copyIndicator = (id) => postAction(`${serviceName}/indicator/copyIndicator/${id}`)
// 删除指标
const deleteByIdIndicator = (params) => postAction(`${serviceName}/indicator/deleteByIdIndicator`, params)
// 审核
const auditIndicatorById = (params) => postAction(`${serviceName}/indicator/auditIndicatorById`, params)
// 审核机构/审核部门
const queryDepartList = (params) => getAction(`${sysDepart}/queryDepartList`, params)
// 审核人
const getUsersByDepartId = (params) => getAction(`/sjsk-system${sysDepart}/getUsersByDepartId`, params)
// 指标详情
const getIndicatorDetails = (id) => getAction(`${serviceName}/indicator/details/${id}`)

/*-----------方案管理-----------*/
// 方案管理列表查询
const getListScheme = (params) => getAction(`${serviceName}/scheme/getListScheme`, params)
// 方案管理添加
const addScheme = (params) => postAction(`${serviceName}/scheme/addScheme`, params)
// 方案管理删除
const deleteScheme = (params) => postAction(`${serviceName}/scheme/deleteScheme`, params)
// 方案管理修改
const updateByIdScheme = (params) => postAction(`${serviceName}/scheme/updateByIdScheme`, params)
// 复制方案
const copyScheme = (id) => postAction(`${serviceName}/scheme/copyScheme/${id}`)
// 方案详情
const findByIdScheme = (id) => getAction(`${serviceName}/scheme/findByIdScheme/${id}`)
// 验证方案
const validScheme = (params) => postAction(`${serviceName}/scheme/validScheme`, params)

/*---------考核计划-----------*/
// 考核计划下发列表查询
const getListAppraisalPlanDown = (params) =>
  getAction(`${serviceName}/appraisalPlanDown/getListAppraisalPlanDown`, params)
// 考核计划下发添加
const addAppraisalPlanDown = (params) => postAction(`${serviceName}/appraisalPlanDown/addAppraisalPlanDown`, params)
// 考核计划下发删除
const deleteAppraisalPlanDown = (params) =>
  postAction(`${serviceName}/appraisalPlanDown/deleteAppraisalPlanDown`, params)
// 考核计划下发详情
const findByIdAppraisalPlanDown = (params) =>
  getAction(`${serviceName}/appraisalPlanDown/findByIdAppraisalPlanDown`, params)
// 考核计划下发修改
const updateByIdAppraisalPlanDown = (params) =>
  postAction(`${serviceName}/appraisalPlanDown/updateByIdAppraisalPlanDown`, params)
// 下发
const downAppraisalPlanDown = (params) => postAction(`${serviceName}/appraisalPlanDown/downAppraisalPlanDown`, params)

// 考核计划分发列表查询
const getListAppraisalPlanSeparate = (params) =>
  getAction(`${serviceName}/appraisalPlanSeparate/getListAppraisalPlanSeparate`, params)
// 考核计划分发详情
const findByIdAppraisalPlanSeparate = (params) =>
  getAction(`${serviceName}/appraisalPlanSeparate/findByIdAppraisalPlanSeparate`, params)
// 分发
const downAppraisal = (params) => postAction(`${serviceName}/appraisalPlanSeparate/downAppraisalPlanDown`, params)
// 考核计划分发添加
const addAppraisalPlanSeparate = (params) =>
  getAction(`${serviceName}/appraisalPlanSeparate/addAppraisalPlanSeparate`, params)

// 考核计划签收列表查询
const getListAppraisalPlanSign = (params) =>
  getAction(`${serviceName}/appraisalPlanSign/getListAppraisalPlanSign`, params)
// 考核计划签收详情
const findByIdAppraisalPlanSign = (params) =>
  getAction(`${serviceName}/appraisalPlanSign/findByIdAppraisalPlanSign`, params)
// 签收
const downAppraisalPlanSign = (params) => postAction(`${serviceName}/appraisalPlanSign/downAppraisalPlanSign`, params)

// 考核计划指派列表查询
const getListAppraisalPlanAssign = (params) =>
  getAction(`${serviceName}/appraisalPlanAssign/getListAppraisalPlanAssign`, params)
// 考核计划指派详情
const findByIdAppraisalPlanAssign = (params) =>
  getAction(`${serviceName}/appraisalPlanAssign/findByIdAppraisalPlanAssign`, params)
// 指派
const downAppraisalPlanAssign = (params) =>
  postAction(`${serviceName}/appraisalPlanAssign/downAppraisalPlanAssign`, params)

/*---------数据填报管理-----------*/
// 数据填报列表查询
const getDataFillList = (params) => getAction(`${serviceName}/dataFill/getDataFillList`, params)
// 数据填报详情
const getDataFillDetail = (params) => getAction(`${serviceName}/dataFill/getDataFillDetail`, params)
// 添加数据填报
const addDataFill = (params) => postAction(`${serviceName}/dataFill/addDataFill`, params)
// 导出数据填报
const exportDataFill = (params) => postAction(`${serviceName}/dataFill/exportDataFill`, params)
// 根据指标编号修改数据填报信息
const updateDataFillById = (params) => postAction(`${serviceName}/dataFill/updateDataFillById`, params)
// 数据填报审核列表查询
const getDataFillExamineList = (params) => getAction(`${serviceName}/dataFill/getDataFillExamineList`, params)
// 添加数据主题
const addDataFillMotif = (params) => postAction(`${serviceName}/dataFill/addDataFillMotif`, params)
// 数据主题修改
const updateDataFillMotif = (params) => postAction(`${serviceName}/dataFill/updateDataFillMotif`, params)
// 数据主题删除
const deleteDataFillMotif = (params) => postAction(`${serviceName}/dataFill/deleteDataFillMotif`, params)
// 数据主题详情
const dataFillMotifDetail = (params) => getAction(`${serviceName}/dataFill/dataFillMotifDetail`, params)
// 数据填报主题审核
const examineDataFillMotif = (params) => postAction(`${serviceName}/dataFill/examineDataFillMotif`, params)
// 数据填报主题提交
const examineDataFillMotifSub = (params) => postAction(`${serviceName}/dataFill/examineDataFillMotifSub`, params)
// 数据填报左边指标树
const getDataFillExamineListTree = (params) => getAction(`${serviceName}/dataFill/getDataFillExamineListTree`, params)

export default {
  getIndicatorList,
  selectIndicatorList,
  getIndicatorDetails,
  addCatalogue,
  updateCatalogue,
  addIndicator,
  exportIndicator,
  updateIndicatorById,
  copyIndicator,
  deleteByIdIndicator,
  auditIndicatorById,
  queryDepartList,
  getUsersByDepartId,
  getListScheme,
  addScheme,
  deleteScheme,
  updateByIdScheme,
  copyScheme,
  findByIdScheme,
  validScheme,
  getListAppraisalPlanDown,
  addAppraisalPlanDown,
  deleteAppraisalPlanDown,
  findByIdAppraisalPlanDown,
  updateByIdAppraisalPlanDown,
  downAppraisalPlanDown,
  getListAppraisalPlanSeparate,
  findByIdAppraisalPlanSeparate,
  downAppraisal,
  addAppraisalPlanSeparate,
  getListAppraisalPlanSign,
  findByIdAppraisalPlanSign,
  downAppraisalPlanSign,
  getListAppraisalPlanAssign,
  findByIdAppraisalPlanAssign,
  downAppraisalPlanAssign,
  getDataFillList,
  addDataFill,
  exportDataFill,
  updateDataFillById,
  getDataFillExamineList,
  addDataFillMotif,
  updateDataFillMotif,
  deleteDataFillMotif,
  dataFillMotifDetail,
  examineDataFillMotif,
  getDataFillDetail,
  examineDataFillMotifSub,
  getDataFillExamineListTree,
}
